<template>
  <el-row class="tac">
    <el-col :span="12">
      <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          :router="true"
      >
        <el-menu-item index="/main/home">
          <el-icon><icon-menu /></el-icon>
          <span>首页</span>
        </el-menu-item>
        <el-sub-menu>
          <template #title>
            <el-icon><setting /></el-icon>
            <span>信息管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/main/staffManage">员工管理</el-menu-item>
            <el-menu-item index="/main/customerManage">顾客管理</el-menu-item>
            <el-menu-item index="/main/productManage">商品管理</el-menu-item>
            <el-menu-item index="/main/materialManage">原材料管理</el-menu-item>
            <el-menu-item index="/main/supplierManage">供应商管理</el-menu-item>
            <el-menu-item index="/main/commentManage">评论管理</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-menu-item index="/main/registerManage">
          <el-icon><Connection /></el-icon>
          <span>注册请求处理</span>
        </el-menu-item>
        <el-menu-item index="/main/pastOrder">
          <el-icon><Tickets /></el-icon>
          <span>过往订单</span>
        </el-menu-item>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
  Connection,
  Tickets,
  WarningFilled
} from '@element-plus/icons-vue'

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>

<style scoped>
* {
  width: 200px;
}
.el-menu-vertical-demo {
  height: 100vh;
}
.el-menu-item {
  border-right: solid 1px var(--el-menu-border-color);
}
</style>
